// OgreMovementAffector.h
// 

#ifndef __MovementAffector_H__
#define __MovementAffector_H__

#include "OgreMath.h"
#include "OgreParticleFXPrerequisites.h"
#include "OgreParticleAffector.h"
#include "OgreStringInterface.h"
#include "OgreVector3.h"

namespace Ogre {

	class _OgreParticleFXExport MovementAffector : public ParticleAffector
	{
	public:
		/// Command object for particle emitter  - see ParamCommand 
		class CmdUseStartVelocity : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdAcceleration : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdRandomnessMax : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdRandomnessMin : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdStartVelocityMax : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdStartVelocityMin : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdVelocityLossMax : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

		/// Command object for particle emitter  - see ParamCommand 
		class CmdVelocityLossMin : public ParamCommand
		{
		public:
			String doGet(const void* target) const;
			void doSet(void* target, const String& val);
		};

	public:

		/** Default constructor. */
		MovementAffector(ParticleSystem* psys);

		/** See ParticleAffector. */
		void _initParticle(Particle* pParticle);

		/** See ParticleAffector. */
		void _affectParticles(ParticleSystem* pSystem, Real timeElapsed);

	public:

		// UseStartVelocity
		void setUseStartVelocity(bool use);
		bool getUseStartVelocity(void) const;

		// Acceleration
		void setAcceleration(const Vector3 &a);
		const Vector3& getAcceleration(void) const;

		// RandomnessMax
		void setRandomnessMax(const Vector3 &rmax);
		const Vector3& getRandomnessMax(void) const;

		// RandomnessMin
		void setRandomnessMin(const Vector3 &rmin);
		const Vector3& getRandomnessMin(void) const;

		// StartVelocityMax
		void setStartVelocityMax(const Vector3 &svmax);
		const Vector3& getStartVelocityMax(void) const;

		// StartVelocityMin
		void setStartVelocityMin(const Vector3 &svmin);
		const Vector3& getStartVelocityMin(void) const;

		// VelocityLossMax
		void setVelocityLossMax(const Vector3 &svlmax);
		const Vector3& getVelocityLossMax(void) const;

		// VelocityLossMin
		void setVelocityLossMin(const Vector3 &svlmin);
		const Vector3& getVelocityLossMin(void) const;

	public:

		static CmdUseStartVelocity  msUseStartVelocityCmd;
		static CmdAcceleration      msAccelerationCmd;
		static CmdRandomnessMax     msRandomnessMaxCmd;
		static CmdRandomnessMin     msRandomnessMinCmd;
		static CmdStartVelocityMax  msStartVelocityMaxCmd;
		static CmdStartVelocityMin  msStartVelocityMinCmd;
		static CmdVelocityLossMax   msVelocityLossMaxCmd;
		static CmdVelocityLossMin   msVelocityLossMinCmd;

	protected:

		bool mUseStartVelocity;

		Vector3 mAcceleration;

		Vector3 mRandomnessMax;
		Vector3 mRandomnessMin;

		Vector3 mStartVelocityMax;
		Vector3 mStartVelocityMin;

		Vector3 mVelocityLossMax;
		Vector3 mVelocityLossMin;
	};

}

#endif
